<template>
  <div>
    <div v-if="pending">
      <n-skeleton text :repeat="2" />
      <n-skeleton text style="width: 60%" />
      <n-skeleton text style="width: 80%" />
    </div>
    <div v-else-if="error">{{ error }}</div>
    <div v-else>
      <slot />
    </div>
  </div>
</template>

<script setup>
import { NSkeleton } from "naive-ui";
defineProps({
  pending: {
    type: Boolean,
    default: true,
  },
  error: {
    type: [Boolean, String, Symbol],
    default: false,
  },
});
</script>
